/* ============================================================
   27-cleverhelp.css
   Modernisierte CleverHelp-Shell (Header, Segment-Tabs,
   SiSurv-Teaser, iFrame-Embed mit Skeleton/Error).
   Selbst-enthaltene, neue Klassen (.ch-*) - kollidiert nicht
   mit dem bestehenden Card-System.
   Bundle-Reihenfolge: nach 24-components.css. Enthaelt eigene
   @media-Regeln, kann daher auch als 27 ans Ende geladen werden.
   ============================================================ */

:root {
    --ch-accent: #009ee0;
    --ch-accent-weak: rgba(0, 158, 224, 0.10);
    --ch-accent-border: rgba(0, 158, 224, 0.28);
    --ch-ink: #2b3448;
    --ch-muted: #6b7688;
    --ch-line: #eceff3;
    --ch-surface: #ffffff;
    --ch-surface-2: #f6f8fa;
    --ch-radius: 12px;
    --ch-radius-sm: 9px;
}

/* ---- Header-Karte ---------------------------------------- */
.ch-header-card .inner-card {
    gap: 1rem;
    padding: 1.15rem 1.25rem 0.55rem;
}

.ch-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.ch-header-titles {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.ch-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ch-ink);
    line-height: 1.1;
}

.ch-title i {
    color: var(--ch-accent);
    font-size: 1.2rem;
}

.ch-subtitle {
    font-size: 0.85rem;
    color: var(--ch-muted);
}

/* ---- Segment-Tabs ---------------------------------------- */
.ch-tabs {
    display: flex;
    align-items: stretch;
    gap: 0.2rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--ch-line);
    margin-top: 0.35rem;
    padding-top: 0.5rem;
}

.ch-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    border-radius: var(--ch-radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ch-muted);
    text-decoration: none;
    line-height: 1;
    border: 1px solid transparent;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    position: relative;
}

.ch-tab i {
    font-size: 0.95rem;
    opacity: 0.9;
}

.ch-tab:hover {
    background-color: var(--ch-surface-2);
    color: var(--ch-ink);
}

.ch-tab.active {
    background-color: var(--ch-accent-weak);
    color: var(--ch-accent);
    border-color: var(--ch-accent-border);
}

/* ---- SiSurv-Teaser (Dashboard) --------------------------- */
.ch-teaser {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.35rem 1.4rem;
    width: 100%;
    background: linear-gradient(120deg, var(--ch-accent-weak), transparent 70%);
    border: 1px solid var(--ch-accent-border);
    border-radius: var(--ch-radius);
    box-sizing: border-box;
}

.ch-teaser-icon {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: var(--ch-radius-sm);
    background: var(--ch-surface);
    border: 1px solid var(--ch-accent-border);
    color: var(--ch-accent);
    font-size: 1.4rem;
}

.ch-teaser-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ch-teaser-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ch-ink);
}

.ch-teaser-text {
    font-size: 0.88rem;
    color: var(--ch-muted);
    max-width: 62ch;
}

.ch-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: var(--ch-radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: transform 0.12s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.ch-btn:active {
    transform: translateY(1px);
}

.ch-btn-primary {
    background: var(--ch-accent);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 158, 224, 0.22);
}

.ch-btn-primary:hover {
    background: #008ac6;
    color: #fff;
}

.ch-btn-ghost {
    background: var(--ch-surface);
    color: var(--ch-ink);
    border-color: var(--ch-line);
}

.ch-btn-ghost:hover {
    background: var(--ch-surface-2);
}

/* ---- iFrame-Embed (Schulungen / SiSurv) ------------------ */
.ch-embed-card .inner-card {
    padding: 0;
}

.ch-embed {
    position: relative;
    width: 100%;
    height: calc(var(--vh, 1vh) * 82);
    min-height: 520px;
    border-radius: var(--ch-radius);
    overflow: hidden;
    border: 1px solid var(--ch-line);
    background: var(--ch-surface);
}

.ch-embed-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Skeleton-Overlay bis das iFrame geladen ist */
.ch-embed-skeleton {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.5rem;
    background: var(--ch-surface);
    z-index: 2;
}

.ch-skel-bar {
    border-radius: var(--ch-radius-sm);
    background: linear-gradient(90deg, var(--ch-surface-2) 25%, #eef1f5 37%, var(--ch-surface-2) 63%);
    background-size: 400% 100%;
    animation: chShimmer 1.4s ease infinite;
}

.ch-skel-bar.lg { height: 40px; width: 42%; }
.ch-skel-bar.row { height: 96px; width: 100%; }
.ch-skel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
    margin-top: 0.3rem;
}
.ch-skel-grid .ch-skel-bar { height: 150px; width: 100%; }

.ch-embed-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--ch-muted);
}

@keyframes chShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

/* Fehlerzustand (Token/Verbindung) */
.ch-embed-error {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.8rem;
    padding: 2rem;
    background: var(--ch-surface);
}

.ch-embed-error i {
    font-size: 2rem;
    color: var(--ch-accent);
}

.ch-embed-error .ch-err-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ch-ink);
}

.ch-embed-error .ch-err-text {
    font-size: 0.88rem;
    color: var(--ch-muted);
    max-width: 46ch;
}

.ch-embed-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.3rem;
}

/* ---- Responsive ------------------------------------------ */
@media (max-width: 768px) {
    .ch-tabs { gap: 0.15rem; }
    .ch-tab span { display: none; }
    .ch-tab { padding: 0.55rem 0.7rem; }
    .ch-teaser { flex-direction: column; align-items: flex-start; }
    .ch-teaser-text { max-width: none; }
    .ch-embed { height: calc(var(--vh, 1vh) * 70); }
}

@media (prefers-reduced-motion: reduce) {
    .ch-skel-bar { animation: none; }
    .ch-btn, .ch-tab { transition: none; }
}






